I want to know Compatibility level please any one can tell what is script for checking compatibility level.
Methods to Know COMPATIBILITY LEVEL of a Database
180616-Sep-2017
Updated on 26-Sep-2017
Home / DeveloperSection / Forums / Methods to Know COMPATIBILITY LEVEL of a Database
I want to know Compatibility level please any one can tell what is script for checking compatibility level.
Amanda Nunes
26-Sep-2017Samuel Fernandes
16-Sep-2017Hi Sushant ,
There are many mehods to know compatibility level I will tell one by one
Now run any of these codes to know the compatibility levels of the newly created database named School_Context
1) Use system stored procedure sp_helpdb
EXEC sp_helpdb School_Context
It shows you two results. The first result has the column named compatibility_level
that shows the value.
2) Use system stored procedure sp_dbcmptlevel
EXEC sp_dbcmptlevel School_Context
The result is
The current compatibility level is 120.
3-Use system views
SELECT name,compatibility_level
FROM sys.databases
WHERE name='School_Context'
The result is 120